#include <iostream>
#include <string>

/**
 * NIOP2018 标题统计
 */
int main() {
    std::string title;

    std::getline(std::cin, title);

    int count = 0;

    for (int i=0; i< title.length(); i++) {
        if (title[i] == ' ' || title[i] == '\n') {
            continue;
        }

        count++;
    }

    std::cout << count;



    return 0;
}